﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 访问者模式
{
    public class IncomeVisitor: IVisitor
    {
        public void Visit(Element element)
        {
            var employee = element as Employee;
            // Provide 10% pay raise
            if (employee != null)
            {
                employee.Income *= 1.10;
                Console.WriteLine($"{employee.GetType().Name} {employee.Name}'s new income: {employee.Income:C}");
            }
        }
    }
}
